require.config({baseUrl: '/js/lib',urlArgs: "v0.0.1"});
require(["zepto", "lib"], function($, lib){
  lib = new lib();
  lib.ajx(lib.getReq().ser + 'recommendLocation/getRecommendInfo.action', {recommendId: 1,pageNo: 1, pageSize: 12,}, function(data){
    if(data.infocode === "0"){
      var h = `<div class="ui-title">${data.info.rlName}
                <a href="${data.info.titleLink}">更多<i class="ui-r-b" style="margin-top: 0.62rem;margin-left: 5px;float: right;"></i></a>
              </div>
              <div class="ui-goods-list">
                <!--每行start-->`;
      $.each(data.info.recommendGoods, function(k, v) {
      	if(k % 3 === 0) h += '<ul>';
      	h += `<li>
                <a href="${v.recomendLink}">
                  <div>
                    <img class="lazy" src="${ lib.getReq().imgPath +　v.mainPictureJpg}"/></p>
                    <p class="ui-desc">${v.chName}</p>
                    <p class="ui-p">￥${v.sellPrice}</p>
                  <div>
                </a>
              </li>`;
      	if((k +　1) % 3 === 0) h += '</ul>';
      });          
      if(data.info.recommendGoods.length % 3 !== 0) h += '</ul>';
      h += '</div>';
      $(".ui-favorite").html(h);
    }else{
      lib.showMessage(data.info);
    }
  }, function(){
    lib.showMessage('网络延时，请稍后再试');
  });
});
